package spring_introduction;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;


//@Component("dogBean")
//@Scope("singleton")
public class Dog implements Pet{

    private String name;

    public Dog(){
        System.out.println(this.getClass().getSimpleName() + " bean is created");
    }

    @PostConstruct
    private void init(){
        System.out.println("Init method from " + this);
    }

    @PreDestroy
    protected void destroy(){
        System.out.println("Destroy method from " + this);
    }

    @Override
    public void say(){
        System.out.println("Bow-Wow");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
